Skip to content

feat(slack): charts in messages from OpenWork - #7843

Open
benjaminshafii wants to merge 1 commit into
devfrom
feat/slack-charts
Open

benjaminshafii wants to merge 1 commit into
devfrom
feat/slack-charts

Conversation

@benjaminshafii

Copy link
Copy Markdown
Member

What is this about?

Messages the OpenWork app posts in Slack can now include a line, area, bar or pie chart: a new chart component next to tables and buttons, under the same slackRichMessages flag.

What problem does it solve?

A trend or a share of a whole reads badly as a table of numbers, and agents had no other way to show one in Slack.

What was the situation before?

Every chart component was refused and nothing was posted.

The agent sends Now arrives as
A chart within Slack's limits The chart
One over a limit (21+ points, 13+ series, long labels) Its title and a table with the same numbers
A third chart in one message A table, or text if a table is already there
A chart Slack refuses The same message with the chart as a table
Values that do not match the categories Refused, with the reason

How is this implemented?

  • slack-assistant/rich-message.ts: chart joins the strict component schema and is sent as Slack's data_visualization block, with every documented limit checked first.
  • The message text carries every number, for notifications, screen readers and the plain retry.
  • Agent instructions say when a chart beats a table and when it does not.
  • Same flag, no new one: it is one more component of a rollout that is off by default, a refused chart becomes a table by itself, and the flag already returns every surface to text.

What else changed?

  • Desktop results now read the fenced slack block, so they can carry a chart.
  • The examples script takes --only= to redraw some pictures.
  • The sample Slack validates and draws the block.

Release note

none

Evidence

evals/proofs/slack-rich-messages.proof.test.ts: before, the chart message is refused; after, the sample Slack draws a line and a pie, and an oversize or third chart arrives as a table. Pictures come from the sample renderer. Nothing was sent to a real Slack workspace.

Adds a `chart` component to the Slack component vocabulary, sent as
Slack's `data_visualization` block (line, area, bar, pie), under the
existing `slackRichMessages` flag.

- Every documented limit is checked before sending: two charts a
  message, title 50, labels and names 20, 12 series or segments, 20
  points, unique series names, one point per category, pie values above
  zero, axis labels 50.
- A chart outside those limits, or a third chart, is sent as a table
  with the same numbers, or as text when the message already has a
  table. Only data that cannot be read (values that do not match the
  categories, a pie with no segments) is refused.
- The message text carries every number, so notifications, screen
  readers and the plain retry still give the data.
- When Slack refuses a message with a chart (a block error or
  invalid_arguments) it is posted again with the chart as a table before
  the existing plain retry.
- Desktop results now read the fenced `slack` block, so a chart can
  appear there too.
- Agents are told when a chart beats a table and when it does not.
- The sample Slack validates the block against the reference and draws
  it; the proof, the API test and the examples cover it.

Same flag rather than a new one: a chart is one more component of a
rollout that is still off by default, a refused chart degrades to a
table on its own, and the flag already returns every surface to text.

Nothing here was sent to a real Slack workspace.
@vercel

vercel Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Nov 28, 2026 11:54pm UTC
openwork-den Ready Ready Preview Nov 28, 2026 11:54pm UTC
openwork-landing Ready Ready Preview, v0 Nov 28, 2026 11:54pm UTC

Request Review

@benjaminshafii

Copy link
Copy Markdown
Member Author

Chart examples (sample renderer, not Slack)

Each picture is the message OpenWork's code produced for the input above it, drawn by the sandbox's sample Slack at 32d6e00. Real Slack will draw the same block its own way; nothing here was sent to a real workspace.

Weekly active users as a line chart (flag on)

Where: The Slack assistant's answer to a mention or DM

Made with: advanceSlackRun posting the turn's last message. The sentence is Markdown; the fenced slack block holds the chart and the source line. The notification text carries every week's number.

The assistant's last message:

Weekly active users reached **1,402** last week, up 32% in eight weeks. The one dip was the week of Nov 9, when imports were down for two days.

```slack
[
  {
    "type": "chart",
    "kind": "line",
    "title": "Weekly active users",
    "categories": [
      "Oct 5",
      "Oct 12",
      "Oct 19",
      "Oct 26",
      "Nov 2",
      "Nov 9",
      "Nov 16",
      "Nov 23"
    ],
    "series": [
      {
        "name": "Users",
        "values": [
          1062,
          1098,
          1120,
          1180,
          1240,
          1228,
          1315,
          1402
        ]
      }
    ],
    "xLabel": "Week starting",
    "yLabel": "Active users"
  },
  {
    "type": "context",
    "text": "From the product database, read just now"
  }
]
```

Weekly active users as a line chart, flag on, drawn by the sample renderer

Pipeline by stage as a bar chart (flag on)

Where: An Automation run sending with slack_send_as_bot

Made with: executeSlackSendAsBot and the DM sender. Two series compare this week with last week across four stages.

Tool call:

{
  "target": "me",
  "text": "Pipeline by stage: $264k open, up $20k on last week. Negotiation is the only stage that shrank.",
  "components": [
    {
      "type": "chart",
      "kind": "bar",
      "title": "Pipeline by stage",
      "categories": [
        "Qualified",
        "Proposal",
        "Negotiation",
        "Won this month"
      ],
      "series": [
        {
          "name": "Last week",
          "values": [
            88,
            71,
            61,
            24
          ]
        },
        {
          "name": "This week",
          "values": [
            96,
            82,
            54.5,
            31.5
          ]
        }
      ],
      "xLabel": "Stage",
      "yLabel": "Value ($k)"
    },
    {
      "type": "context",
      "text": "Weekly pipeline report, ran Mon Nov 23 at 9:00 AM"
    },
    {
      "type": "buttons",
      "buttons": [
        {
          "text": "Open the pipeline",
          "url": "https://crm.example.com/pipeline"
        }
      ]
    }
  ]
}

Pipeline by stage as a bar chart, flag on, drawn by the sample renderer

Spend by model as a pie chart (flag on)

Where: A chat or Automation sending with slack_send_as_bot

Made with: executeSlackSendAsBot and the DM sender. The model names are made up.

Tool call:

{
  "target": "me",
  "text": "AI spend so far in November is $1,040. Atlas Large is most of it.",
  "components": [
    {
      "type": "chart",
      "kind": "pie",
      "title": "Spend by model",
      "segments": [
        {
          "label": "Atlas Large",
          "value": 620
        },
        {
          "label": "Atlas Fast",
          "value": 255
        },
        {
          "label": "Embeddings",
          "value": 125
        },
        {
          "label": "Other",
          "value": 40
        }
      ]
    },
    {
      "type": "context",
      "text": "From the billing export, Nov 1 to Nov 27, in dollars"
    }
  ]
}

Spend by model as a pie chart, flag on, drawn by the sample renderer

A chart with more points than Slack draws, sent as a table (flag on)

Where: A chat or Automation sending with slack_send_as_bot

Made with: executeSlackSendAsBot. Twenty-six weeks is past Slack's twenty points for a chart, so OpenWork sends the title and the same numbers as a table instead of a block Slack would refuse.

Tool call:

{
  "target": "me",
  "text": "Signups by week since June: 468 last week, the highest so far.",
  "components": [
    {
      "type": "chart",
      "kind": "line",
      "title": "Signups by week",
      "categories": [
        "Jun 1",
        "Jun 8",
        "Jun 15",
        "Jun 22",
        "Jun 29",
        "Jul 6",
        "Jul 13",
        "Jul 20",
        "Jul 27",
        "Aug 3",
        "Aug 10",
        "Aug 17",
        "Aug 24",
        "Aug 31",
        "Sep 7",
        "Sep 14",
        "Sep 21",
        "Sep 28",
        "Oct 5",
        "Oct 12",
        "Oct 19",
        "Oct 26",
        "Nov 2",
        "Nov 9",
        "Nov 16",
        "Nov 23"
      ],
      "series": [
        {
          "name": "Signups",
          "values": [
            251,
            263,
            258,
            270,
            284,
            279,
            291,
            305,
            298,
            312,
            320,
            317,
            331,
            344,
            339,
            352,
            360,
            371,
            366,
            380,
            395,
            389,
            404,
            398,
            412,
            468
          ]
        }
      ],
      "xLabel": "Week starting"
    },
    {
      "type": "context",
      "text": "From the product database"
    }
  ]
}

A chart with more points than Slack draws, sent as a table, flag on, drawn by the sample renderer

This branch was successfully deployed

3 active deployments
Preview – openwork-den — 32d6e001 Deployed Nov 28, 2026 by vercel[bot]
Preview – openwork-app — 32d6e001 Deployed Nov 28, 2026 by vercel[bot]
Preview – openwork-landing — 32d6e001 Deployed Nov 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant